package com.seeyon.v3x.rota.manager;

import java.util.List;

import com.seeyon.v3x.rota.dao.IRotaDao;
import com.seeyon.v3x.rota.domain.TResourceDuty;

public class RotaManagerImpl implements RotaManager {

	private IRotaDao rotaDao;
	
	public RotaManagerImpl () {
		rotaDao = RotaFactory.createRotaDao();
	}

	public IRotaDao getRotaDao() {
		return rotaDao;
	}

	public void setRotaDao(IRotaDao rotaDao) {
		this.rotaDao = rotaDao;
	}
	
	
	public List findByLikeProperty(String likeName, String value) {
		if(rotaDao != null) {
        	System.out.println("---------1111111111111----------");
        }
		return rotaDao.findByLikeProperty(likeName, value);
	}

	public int addTask(TResourceDuty trd) {
		return rotaDao.addTask(trd);
	}
	
	public void updateTask(TResourceDuty trd) {
		rotaDao.updateTask(trd);
	}
	
	public TResourceDuty findTaskById(Integer id) {
		System.out.println("---------开始根据唯一ID查询！----------");
		return rotaDao.findTaskById(id);
	}
	
	public void deleteTask(TResourceDuty trd) {
		
		rotaDao.delete(trd);
	}

}
